]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
screenshot: Make captureScreenshot() return the GFile
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Sat, 28 Oct 2023 22:14:39 +0000 (19:14 -0300)
committerMarge Bot <marge-bot@gnome.org>
Thu, 21 Dec 2023 17:59:17 +0000 (17:59 +0000)
Make the captureScreenshot() auxiliary function return the GFile at
which the texture was saved. This file will be used to return the
screenshot URI to the new D-Bus method to take interactive
screenshots.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2999>

js/ui/screenshot.js

index 8875d9325feb3e513c6d8cd785e949707919ed86..cfd5fbd85028f23b2e8e7d8850253cd53fd771f0 100644 (file)
@@ -2279,6 +2279,8 @@ function _storeScreenshot(bytes, pixbuf) {
     notification.setTransient(true);
     Main.messageTray.add(source);
     source.showNotification(notification);
+
+    return file;
 }
 
 /**
@@ -2312,7 +2314,7 @@ export async function captureScreenshot(texture, geometry, scale, cursor) {
     );
 
     stream.close(null);
-    _storeScreenshot(stream.steal_as_bytes(), pixbuf);
+    return _storeScreenshot(stream.steal_as_bytes(), pixbuf);
 }
 
 /**